<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS -fno-warn-orphans #-}</span><span>
</span><span id="line-2"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Time.Calendar.Gregorian</span><span>
</span><span id="line-3"></span><span class="hs-special">(</span><span>
</span><span id="line-4"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Gregorian calendar</span></span><span>
</span><span id="line-5"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier">toGregorian</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#fromGregorian"><span class="hs-identifier">fromGregorian</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#fromGregorianValid"><span class="hs-identifier">fromGregorianValid</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#showGregorian"><span class="hs-identifier">showGregorian</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#gregorianMonthLength"><span class="hs-identifier">gregorianMonthLength</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-comment">-- calendrical arithmetic</span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-comment">-- e.g. &quot;one month after March 31st&quot;</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsClip"><span class="hs-identifier">addGregorianMonthsClip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsRollOver"><span class="hs-identifier">addGregorianMonthsRollOver</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsClip"><span class="hs-identifier">addGregorianYearsClip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsRollOver"><span class="hs-identifier">addGregorianYearsRollOver</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationClip"><span class="hs-identifier">addGregorianDurationClip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationRollOver"><span class="hs-identifier">addGregorianDurationRollOver</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationClip"><span class="hs-identifier">diffGregorianDurationClip</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationRollOver"><span class="hs-identifier">diffGregorianDurationRollOver</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span>    </span><span class="hs-comment">-- re-exported from OrdinalDate</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><a href="Data.Time.Calendar.OrdinalDate.html#isLeapYear"><span class="hs-identifier">isLeapYear</span></a></span><span>
</span><span id="line-16"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.MonthDay.html"><span class="hs-identifier">Data.Time.Calendar.MonthDay</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.OrdinalDate.html"><span class="hs-identifier">Data.Time.Calendar.OrdinalDate</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html"><span class="hs-identifier">Data.Time.Calendar.Days</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html"><span class="hs-identifier">Data.Time.Calendar.CalendarDiffDays</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Private.html"><span class="hs-identifier">Data.Time.Calendar.Private</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-comment">-- | Convert to proleptic Gregorian calendar. First element of result is year, second month number (1-12), third day (1-31).</span><span>
</span><span id="line-25"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-type">toGregorian</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span id="toGregorian"><span class="annot"><span class="annottext">toGregorian :: Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var hs-var">toGregorian</span></a></span></span><span> </span><span id="local-6989586621679068840"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068840"><span class="hs-identifier hs-var">date</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068839"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068838"><span class="hs-identifier hs-var">month</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068837"><span class="hs-identifier hs-var">day</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068839"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068839"><span class="hs-identifier hs-var">year</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068836"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068836"><span class="hs-identifier hs-var">yd</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int)
</span><a href="Data.Time.Calendar.OrdinalDate.html#toOrdinalDate"><span class="hs-identifier hs-var">toOrdinalDate</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068840"><span class="hs-identifier hs-var">date</span></a></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068838"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068838"><span class="hs-identifier hs-var">month</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068837"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068837"><span class="hs-identifier hs-var">day</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; (Int, Int)
</span><a href="Data.Time.Calendar.MonthDay.html#dayOfYearToMonthAndDay"><span class="hs-identifier hs-var">dayOfYearToMonthAndDay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.OrdinalDate.html#isLeapYear"><span class="hs-identifier hs-var">isLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068839"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068836"><span class="hs-identifier hs-var">yd</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-comment">-- | Convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31).</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- Invalid values will be clipped to the correct range, month first, then day.</span><span>
</span><span id="line-32"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#fromGregorian"><span class="hs-identifier hs-type">fromGregorian</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-33"></span><span id="fromGregorian"><span class="annot"><span class="annottext">fromGregorian :: Integer -&gt; Int -&gt; Int -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#fromGregorian"><span class="hs-identifier hs-var hs-var">fromGregorian</span></a></span></span><span> </span><span id="local-6989586621679068833"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068833"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span id="local-6989586621679068832"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068832"><span class="hs-identifier hs-var">month</span></a></span></span><span> </span><span id="local-6989586621679068831"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068831"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Day
</span><a href="Data.Time.Calendar.OrdinalDate.html#fromOrdinalDate"><span class="hs-identifier hs-var">fromOrdinalDate</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068833"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYear"><span class="hs-identifier hs-var">monthAndDayToDayOfYear</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.OrdinalDate.html#isLeapYear"><span class="hs-identifier hs-var">isLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068833"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068832"><span class="hs-identifier hs-var">month</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068831"><span class="hs-identifier hs-var">day</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- | Convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31).</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- Invalid values will return Nothing</span><span>
</span><span id="line-37"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#fromGregorianValid"><span class="hs-identifier hs-type">fromGregorianValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-38"></span><span id="fromGregorianValid"><span class="annot"><span class="annottext">fromGregorianValid :: Integer -&gt; Int -&gt; Int -&gt; Maybe Day
</span><a href="Data.Time.Calendar.Gregorian.html#fromGregorianValid"><span class="hs-identifier hs-var hs-var">fromGregorianValid</span></a></span></span><span> </span><span id="local-6989586621679068828"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068828"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span id="local-6989586621679068827"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068827"><span class="hs-identifier hs-var">month</span></a></span></span><span> </span><span id="local-6989586621679068826"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068826"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-39"></span><span>    </span><span id="local-6989586621679068825"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068825"><span class="hs-identifier hs-var">doy</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int -&gt; Maybe Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthAndDayToDayOfYearValid"><span class="hs-identifier hs-var">monthAndDayToDayOfYearValid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.OrdinalDate.html#isLeapYear"><span class="hs-identifier hs-var">isLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068828"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068827"><span class="hs-identifier hs-var">month</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068826"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Maybe Day
</span><a href="Data.Time.Calendar.OrdinalDate.html#fromOrdinalDateValid"><span class="hs-identifier hs-var">fromOrdinalDateValid</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068828"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068825"><span class="hs-identifier hs-var">doy</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | Show in ISO 8601 format (yyyy-mm-dd)</span><span>
</span><span id="line-43"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#showGregorian"><span class="hs-identifier hs-type">showGregorian</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-44"></span><span id="showGregorian"><span class="annot"><span class="annottext">showGregorian :: Day -&gt; String
</span><a href="Data.Time.Calendar.Gregorian.html#showGregorian"><span class="hs-identifier hs-var hs-var">showGregorian</span></a></span></span><span> </span><span id="local-6989586621679068822"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068822"><span class="hs-identifier hs-var">date</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; String
forall t. ShowPadded t =&gt; t -&gt; String
</span><a href="Data.Time.Calendar.Private.html#show4"><span class="hs-identifier hs-var">show4</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068820"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall t. ShowPadded t =&gt; t -&gt; String
</span><a href="Data.Time.Calendar.Private.html#show2"><span class="hs-identifier hs-var">show2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068818"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall t. ShowPadded t =&gt; t -&gt; String
</span><a href="Data.Time.Calendar.Private.html#show2"><span class="hs-identifier hs-var">show2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068817"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068820"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068820"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068818"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068818"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068817"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068817"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068822"><span class="hs-identifier hs-var">date</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-comment">-- | The number of days in a given month according to the proleptic Gregorian calendar. First argument is year, second is month.</span><span>
</span><span id="line-48"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#gregorianMonthLength"><span class="hs-identifier hs-type">gregorianMonthLength</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-49"></span><span id="gregorianMonthLength"><span class="annot"><span class="annottext">gregorianMonthLength :: Integer -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.Gregorian.html#gregorianMonthLength"><span class="hs-identifier hs-var hs-var">gregorianMonthLength</span></a></span></span><span> </span><span id="local-6989586621679068816"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068816"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Int
</span><a href="Data.Time.Calendar.MonthDay.html#monthLength"><span class="hs-identifier hs-var">monthLength</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.OrdinalDate.html#isLeapYear"><span class="hs-identifier hs-var">isLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068816"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#rolloverMonths"><span class="hs-identifier hs-type">rolloverMonths</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span id="rolloverMonths"><span class="annot"><span class="annottext">rolloverMonths :: (Integer, Integer) -&gt; (Integer, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#rolloverMonths"><span class="hs-identifier hs-var hs-var">rolloverMonths</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679068813"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068813"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068812"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068812"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068813"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068812"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><span class="annottext">Integer -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068812"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonths"><span class="hs-identifier hs-type">addGregorianMonths</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span id="addGregorianMonths"><span class="annot"><span class="annottext">addGregorianMonths :: Integer -&gt; Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonths"><span class="hs-identifier hs-var hs-var">addGregorianMonths</span></a></span></span><span> </span><span id="local-6989586621679068807"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068807"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679068806"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068806"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068805"><span class="hs-identifier hs-var">y'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068804"><span class="hs-identifier hs-var">m'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068803"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068802"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068802"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068801"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068801"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068803"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068803"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068806"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068805"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068805"><span class="hs-identifier hs-var">y'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068804"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068804"><span class="hs-identifier hs-var">m'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Integer) -&gt; (Integer, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#rolloverMonths"><span class="hs-identifier hs-var">rolloverMonths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068802"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068801"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068807"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-comment">-- | Add months, with days past the last day of the month clipped to the last day.</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- For instance, 2005-01-30 + 1 month = 2005-02-28.</span><span>
</span><span id="line-61"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsClip"><span class="hs-identifier hs-type">addGregorianMonthsClip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-62"></span><span id="addGregorianMonthsClip"><span class="annot"><span class="annottext">addGregorianMonthsClip :: Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsClip"><span class="hs-identifier hs-var hs-var">addGregorianMonthsClip</span></a></span></span><span> </span><span id="local-6989586621679068797"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068797"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679068796"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068796"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Int -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#fromGregorian"><span class="hs-identifier hs-var">fromGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068795"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068794"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068793"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068795"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068795"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068794"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068794"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068793"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068793"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonths"><span class="hs-identifier hs-var">addGregorianMonths</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068797"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068796"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-comment">-- | Add months, with days past the last day of the month rolling over to the next month.</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- For instance, 2005-01-30 + 1 month = 2005-03-02.</span><span>
</span><span id="line-67"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsRollOver"><span class="hs-identifier hs-type">addGregorianMonthsRollOver</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-68"></span><span id="addGregorianMonthsRollOver"><span class="annot"><span class="annottext">addGregorianMonthsRollOver :: Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsRollOver"><span class="hs-identifier hs-var hs-var">addGregorianMonthsRollOver</span></a></span></span><span> </span><span id="local-6989586621679068792"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068792"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679068791"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068791"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#addDays"><span class="hs-identifier hs-var">addDays</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068789"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Int -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#fromGregorian"><span class="hs-identifier hs-var">fromGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068788"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068787"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068788"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068788"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068787"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068787"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068789"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068789"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonths"><span class="hs-identifier hs-var">addGregorianMonths</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068792"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068791"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-comment">-- | Add years, matching month and day, with Feb 29th clipped to Feb 28th if necessary.</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- For instance, 2004-02-29 + 2 years = 2006-02-28.</span><span>
</span><span id="line-73"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsClip"><span class="hs-identifier hs-type">addGregorianYearsClip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-74"></span><span id="addGregorianYearsClip"><span class="annot"><span class="annottext">addGregorianYearsClip :: Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsClip"><span class="hs-identifier hs-var hs-var">addGregorianYearsClip</span></a></span></span><span> </span><span id="local-6989586621679068786"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068786"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsClip"><span class="hs-identifier hs-var">addGregorianMonthsClip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068786"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | Add years, matching month and day, with Feb 29th rolled over to Mar 1st if necessary.</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- For instance, 2004-02-29 + 2 years = 2006-03-01.</span><span>
</span><span id="line-78"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsRollOver"><span class="hs-identifier hs-type">addGregorianYearsRollOver</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-79"></span><span id="addGregorianYearsRollOver"><span class="annot"><span class="annottext">addGregorianYearsRollOver :: Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianYearsRollOver"><span class="hs-identifier hs-var hs-var">addGregorianYearsRollOver</span></a></span></span><span> </span><span id="local-6989586621679068784"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068784"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsRollOver"><span class="hs-identifier hs-var">addGregorianMonthsRollOver</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068784"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">-- | Add months (clipped to last day), then add days</span><span>
</span><span id="line-82"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationClip"><span class="hs-identifier hs-type">addGregorianDurationClip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-83"></span><span id="addGregorianDurationClip"><span class="annot"><span class="annottext">addGregorianDurationClip :: CalendarDiffDays -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationClip"><span class="hs-identifier hs-var hs-var">addGregorianDurationClip</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span> </span><span id="local-6989586621679068782"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068782"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679068781"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068781"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679068780"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068780"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#addDays"><span class="hs-identifier hs-var">addDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068781"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">(Day -&gt; Day) -&gt; Day -&gt; Day
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsClip"><span class="hs-identifier hs-var">addGregorianMonthsClip</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068782"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068780"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">-- | Add months (rolling over to next month), then add days</span><span>
</span><span id="line-86"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationRollOver"><span class="hs-identifier hs-type">addGregorianDurationRollOver</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-87"></span><span id="addGregorianDurationRollOver"><span class="annot"><span class="annottext">addGregorianDurationRollOver :: CalendarDiffDays -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationRollOver"><span class="hs-identifier hs-var hs-var">addGregorianDurationRollOver</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span> </span><span id="local-6989586621679068779"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068779"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679068778"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068778"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679068777"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068777"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#addDays"><span class="hs-identifier hs-var">addDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068778"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">(Day -&gt; Day) -&gt; Day -&gt; Day
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianMonthsRollOver"><span class="hs-identifier hs-var">addGregorianMonthsRollOver</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068779"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068777"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | Calendrical difference, with as many whole months as possible</span><span>
</span><span id="line-90"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationClip"><span class="hs-identifier hs-type">diffGregorianDurationClip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span>
</span><span id="line-91"></span><span id="diffGregorianDurationClip"><span class="annot"><span class="annottext">diffGregorianDurationClip :: Day -&gt; Day -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationClip"><span class="hs-identifier hs-var hs-var">diffGregorianDurationClip</span></a></span></span><span> </span><span id="local-6989586621679068776"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068776"><span class="hs-identifier hs-var">day2</span></a></span></span><span> </span><span id="local-6989586621679068775"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068775"><span class="hs-identifier hs-var">day1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068774"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068774"><span class="hs-identifier hs-var">y1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068773"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068773"><span class="hs-identifier hs-var">m1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068772"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068772"><span class="hs-identifier hs-var">d1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068775"><span class="hs-identifier hs-var">day1</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068771"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068771"><span class="hs-identifier hs-var">y2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068770"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068770"><span class="hs-identifier hs-var">m2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068769"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068769"><span class="hs-identifier hs-var">d2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068776"><span class="hs-identifier hs-var">day2</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span id="local-6989586621679068764"><span class="annot"><span class="annottext">ym1 :: Integer
</span><a href="#local-6989586621679068764"><span class="hs-identifier hs-var hs-var">ym1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068774"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068773"><span class="hs-identifier hs-var">m1</span></a></span><span>
</span><span id="line-95"></span><span>    </span><span id="local-6989586621679068759"><span class="annot"><span class="annottext">ym2 :: Integer
</span><a href="#local-6989586621679068759"><span class="hs-identifier hs-var hs-var">ym2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068771"><span class="hs-identifier hs-var">y2</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068770"><span class="hs-identifier hs-var">m2</span></a></span><span>
</span><span id="line-96"></span><span>    </span><span id="local-6989586621679068757"><span class="annot"><span class="annottext">ymdiff :: Integer
</span><a href="#local-6989586621679068757"><span class="hs-identifier hs-var hs-var">ymdiff</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068759"><span class="hs-identifier hs-var">ym2</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068764"><span class="hs-identifier hs-var">ym1</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span id="local-6989586621679068747"><span class="annot"><span class="annottext">ymAllowed :: Integer
</span><a href="#local-6989586621679068747"><span class="hs-identifier hs-var hs-var">ymAllowed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068776"><span class="hs-identifier hs-var">day2</span></a></span><span> </span><span class="annot"><span class="annottext">Day -&gt; Day -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068775"><span class="hs-identifier hs-var">day1</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-99"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068769"><span class="hs-identifier hs-var">d2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068772"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068757"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068757"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068769"><span class="hs-identifier hs-var">d2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068772"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068757"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068757"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621679068745"><span class="annot"><span class="annottext">dayAllowed :: Day
</span><a href="#local-6989586621679068745"><span class="hs-identifier hs-var hs-var">dayAllowed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CalendarDiffDays -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationClip"><span class="hs-identifier hs-var">addGregorianDurationClip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-var">CalendarDiffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068747"><span class="hs-identifier hs-var">ymAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068775"><span class="hs-identifier hs-var">day1</span></a></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-var">CalendarDiffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068747"><span class="hs-identifier hs-var">ymAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; CalendarDiffDays) -&gt; Integer -&gt; CalendarDiffDays
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Day -&gt; Day -&gt; Integer
</span><a href="Data.Time.Calendar.Days.html#diffDays"><span class="hs-identifier hs-var">diffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068776"><span class="hs-identifier hs-var">day2</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068745"><span class="hs-identifier hs-var">dayAllowed</span></a></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="hs-comment">-- | Calendrical difference, with as many whole months as possible.</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- Same as 'diffGregorianDurationClip' for positive durations.</span><span>
</span><span id="line-106"></span><span class="annot"><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationRollOver"><span class="hs-identifier hs-type">diffGregorianDurationRollOver</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-type">CalendarDiffDays</span></a></span><span>
</span><span id="line-107"></span><span id="diffGregorianDurationRollOver"><span class="annot"><span class="annottext">diffGregorianDurationRollOver :: Day -&gt; Day -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.Gregorian.html#diffGregorianDurationRollOver"><span class="hs-identifier hs-var hs-var">diffGregorianDurationRollOver</span></a></span></span><span> </span><span id="local-6989586621679068743"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068743"><span class="hs-identifier hs-var">day2</span></a></span></span><span> </span><span id="local-6989586621679068742"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068742"><span class="hs-identifier hs-var">day1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068741"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068741"><span class="hs-identifier hs-var">y1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068740"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068740"><span class="hs-identifier hs-var">m1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068739"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068739"><span class="hs-identifier hs-var">d1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068742"><span class="hs-identifier hs-var">day1</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068738"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068738"><span class="hs-identifier hs-var">y2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068737"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068737"><span class="hs-identifier hs-var">m2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068736"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068736"><span class="hs-identifier hs-var">d2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int, Int)
</span><a href="Data.Time.Calendar.Gregorian.html#toGregorian"><span class="hs-identifier hs-var">toGregorian</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068743"><span class="hs-identifier hs-var">day2</span></a></span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621679068731"><span class="annot"><span class="annottext">ym1 :: Integer
</span><a href="#local-6989586621679068731"><span class="hs-identifier hs-var hs-var">ym1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068741"><span class="hs-identifier hs-var">y1</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068740"><span class="hs-identifier hs-var">m1</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span id="local-6989586621679068726"><span class="annot"><span class="annottext">ym2 :: Integer
</span><a href="#local-6989586621679068726"><span class="hs-identifier hs-var hs-var">ym2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068738"><span class="hs-identifier hs-var">y2</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068737"><span class="hs-identifier hs-var">m2</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span id="local-6989586621679068724"><span class="annot"><span class="annottext">ymdiff :: Integer
</span><a href="#local-6989586621679068724"><span class="hs-identifier hs-var hs-var">ymdiff</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068726"><span class="hs-identifier hs-var">ym2</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068731"><span class="hs-identifier hs-var">ym1</span></a></span><span>
</span><span id="line-113"></span><span>    </span><span id="local-6989586621679068716"><span class="annot"><span class="annottext">ymAllowed :: Integer
</span><a href="#local-6989586621679068716"><span class="hs-identifier hs-var hs-var">ymAllowed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068743"><span class="hs-identifier hs-var">day2</span></a></span><span> </span><span class="annot"><span class="annottext">Day -&gt; Day -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068742"><span class="hs-identifier hs-var">day1</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-115"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068736"><span class="hs-identifier hs-var">d2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068739"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068724"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068724"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068736"><span class="hs-identifier hs-var">d2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068739"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068724"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068724"><span class="hs-identifier hs-var">ymdiff</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679068715"><span class="annot"><span class="annottext">dayAllowed :: Day
</span><a href="#local-6989586621679068715"><span class="hs-identifier hs-var hs-var">dayAllowed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CalendarDiffDays -&gt; Day -&gt; Day
</span><a href="Data.Time.Calendar.Gregorian.html#addGregorianDurationRollOver"><span class="hs-identifier hs-var">addGregorianDurationRollOver</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-var">CalendarDiffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068716"><span class="hs-identifier hs-var">ymAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068742"><span class="hs-identifier hs-var">day1</span></a></span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; CalendarDiffDays
</span><a href="Data.Time.Calendar.CalendarDiffDays.html#CalendarDiffDays"><span class="hs-identifier hs-var">CalendarDiffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068716"><span class="hs-identifier hs-var">ymAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; CalendarDiffDays) -&gt; Integer -&gt; CalendarDiffDays
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Day -&gt; Day -&gt; Integer
</span><a href="Data.Time.Calendar.Days.html#diffDays"><span class="hs-identifier hs-var">diffDays</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068743"><span class="hs-identifier hs-var">day2</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068715"><span class="hs-identifier hs-var">dayAllowed</span></a></span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-comment">-- orphan instance</span><span>
</span><span id="line-121"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679068710"><span id="local-6989586621679068713"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679068708"><span class="annot"><span class="annottext">show :: Day -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; String
</span><a href="Data.Time.Calendar.Gregorian.html#showGregorian"><span class="hs-identifier hs-var">showGregorian</span></a></span><span>
</span><span id="line-123"></span></pre></body></html>